Simplify trace header some more, and ensure that
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 30 Oct 2005 22:28:32 +0000 (23:28 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 30 Oct 2005 22:28:32 +0000 (23:28 +0100)
construction of arguments for tracing is outlined from
straightline code paths.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/trace.c
xen/include/xen/trace.h

index 512ab4a59a1c5f693e021d7ba625aaeeb6562e75..becdaff85348804170d35d9a005b12ed88e1c86b 100644 (file)
@@ -40,7 +40,7 @@ static struct t_buf *t_bufs[NR_CPUS];
 
 /* a flag recording whether initialization has been done */
 /* or more properly, if the tbuf subsystem is enabled right now */
-int tb_init_done = 0;
+int tb_init_done;
 
 /* which CPUs tracing is enabled on */
 static unsigned long tb_cpu_mask = (~0UL);
index 8e5e2827690adc53fe3442822b8918e6765539ca..e09051c2591e9715d4691ce3a10b7b4d828b1d22 100644 (file)
 #ifndef __XEN_TRACE_H__
 #define __XEN_TRACE_H__
 
-#include <asm/page.h>
-#include <xen/types.h>
-#include <xen/sched.h>
+#include <xen/config.h>
 #include <asm/atomic.h>
-#include <asm/current.h>
-#include <asm/msr.h>
 #include <public/dom0_ops.h>
 #include <public/trace.h>
 
@@ -46,7 +42,7 @@ void trace(u32 event, unsigned long d1, unsigned long d2,
 /* Avoids troubling the caller with casting their arguments to a trace macro */
 #define trace_do_casts(e,d1,d2,d3,d4,d5) \
     do {                                 \
-        if ( tb_init_done )              \
+        if ( unlikely(tb_init_done) )    \
             trace(e,                     \
                  (unsigned long)d1,      \
                  (unsigned long)d2,      \